package makehintcode

import (
	"fmt"
	"io/ioutil"
	"myOJ/db/getproblem"
	"strings"
)

func MakePYHint(ptitle string) string {
	args := getproblem.GetArgs(ptitle)

	argsString := ""
	for i := range args {
		argsString += args[i].Argname
		if i < len(args)-1 {
			argsString += ","
		}
	}
	file, err := ioutil.ReadFile("makehintcode/pyHintTemplate")
	if err != nil {
		fmt.Println("MakePYHint read file ", err)
		return ""
	}
	pyTemp := string(file)
	return strings.ReplaceAll(pyTemp, "theArgs", argsString)
}
